#include "AIPatrolState.h"

#include "..\Game Objects\Enemy.h"

AIPatrolState::AIPatrolState()
{
	bMoveLeft = true;
	bMoveRight = false;
}


AIPatrolState::~AIPatrolState()
{
}

void AIPatrolState::Update(Enemy* enemy, float dt)
{
	if (enemy->IsMovingLeft())
	{
		if (enemy->GetPosition().x <= enemy->GetPatrolPointLeft().x)
			enemy->IsMovingLeft(false);
	}
	else if (!enemy->IsMovingLeft())
	{
		if (enemy->GetPosition().x >= enemy->GetPatrolPointRight().x)
			enemy->IsMovingLeft(true);
	}
}